package com.chis.ms;

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class T2 {

    public static void main(String[] args) {
        List<String> list1 = tt1("C:\\Users\\wlj\\Desktop\\aa.txt");
        List<String> list2 = tt2("C:\\Users\\wlj\\Desktop\\bb.txt");
        List<String> list3 = tt2("C:\\Users\\wlj\\Desktop\\aa.txt");
        for(String key : list1) {
            if (!list2.contains(key)) {
                for(String t : list3){
                    if(t.contains(key)){
                        System.out.println(t);
                    }
                }

            }
        }






    }



    public static List<String> tt1(String path) {
        File file1 = new File(path);
        FileReader m = null;
        try {
            m = new FileReader(file1);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        BufferedReader reader = new BufferedReader(m);
        List<String> l = new ArrayList<>();
        while (true) {
            String nextline = null;
            try {
                nextline = reader.readLine();
                if (nextline != null && nextline.length() > 8) {

                    String  sds = nextline.substring(nextline.indexOf("#")+1).trim();
                    l.add(sds);

                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (nextline == null) break;
        }
        return l;
    }

    public static List<String> tt2(String path) {
        File file1 = new File(path);
        FileReader m = null;
        try {
            m = new FileReader(file1);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        BufferedReader reader = new BufferedReader(m);
        List<String> l = new ArrayList<>();
        while (true) {
            String nextline = null;
            try {
                nextline = reader.readLine();
                if (nextline != null && nextline.length() > 8) {


                    l.add(nextline.trim());

                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (nextline == null) break;
        }
        return l;
    }

}
